Getting Started
This guide helps you set up and run the WhatsappBulkMessaging desktop application. It covers prerequisites, installation, environment configuration, initial setup, quick start examples for each messaging service, troubleshooting, and verification steps. The application combines an Electron + React frontend with a Python backend for advanced contact processing.
Ensure your system meets these requirements before installing:
Node.js 16 or newer
Python 3.8 or newer
Google Cloud Console access for Gmail API
A WhatsApp account
SMTP server credentials (if using SMTP method)
These prerequisites are documented in the project’s Getting Started section.
Section sources
Follow these step-by-step instructions to install the application:
Clone the repository:
bashgit clone https://github.com/tashifkhan/bulk-messaging-system cd WhatsappBulkMessagingInstall Electron dependencies:
bashcd electron npm installInstall Python backend dependencies:
bashcd ../python-backend pip install -r requirements.txtStart the development server:
bash# From the electron directory npm run dev
This starts both the React development server and the Electron main process concurrently.
Section sources
Configure environment variables for Gmail API authentication:
Create a
.envfile in theelectrondirectory with your Google OAuth2 credentials:textGOOGLE_CLIENT_ID=your_client_id_here GOOGLE_CLIENT_SECRET=your_client_secret_hereFollow the Gmail API setup steps in the project documentation to create credentials and enable the Gmail API.
These configurations enable secure OAuth2 authentication for Gmail API integration.
Section sources
Connect to WhatsApp using QR code authentication:
Open the application and navigate to the WhatsApp tab.
Click “Connect to WhatsApp”.
Scan the QR code displayed in the app using your phone’s WhatsApp.
Wait for authentication to complete.
The Electron main process manages the WhatsApp client lifecycle, handles QR generation, and emits status updates to the renderer.
Diagram sources
Section sources
WhatsApp Messaging#
Connect to WhatsApp using the QR code workflow described above.
Import contacts via CSV/Excel or add numbers manually.
Compose your message, optionally using
{{name}}for personalization.Set a delay between messages and click “Send Mass Messages”.
The Electron main process sends messages using the WhatsApp Web client and reports progress.
Section sources
Gmail API#
Navigate to the Gmail tab.
Click “Authenticate Gmail” to open the OAuth consent flow.
After successful authentication, import or enter email addresses.
Compose your email (subject and HTML content supported).
Set the delay between emails and click “Send Bulk Email”.
The Gmail handler manages OAuth2 flow and sends emails via the Gmail API.
Section sources
SMTP#
Navigate to the SMTP tab.
Enter your SMTP server configuration (host, port, username, password).
Optionally enable secure connection (SSL/TLS).
Import or enter email addresses.
Compose your email and set the delay between emails.
Click “Send SMTP Email”.
The SMTP handler validates configuration, connects to the server, and sends emails.
Section sources
The application follows a hybrid architecture combining Electron + React for the UI and Python for backend utilities.
smtp-handler.js] end subgraph "Messaging Services" WA[whatsapp-web.js] Gmail[Gmail API] SMTP[Nodemailer] end subgraph "Python Backend" PyAPI[Flask API] Utils[Contact Processing] end UI --> Preload Preload --> Main Main --> Handlers Handlers --> WA Handlers --> Gmail Handlers --> SMTP UI --> PyAPI PyAPI --> Utils
Diagram sources
Section sources
Electron Main Process#
The main process orchestrates:
Window creation and development vs production loading
IPC handlers for Gmail, SMTP, and WhatsApp
WhatsApp client lifecycle (init, QR, ready, authenticated, disconnected)
Contact import and email list parsing
with preload context"] CreateWindow --> RegisterHandlers["Register IPC Handlers
Gmail | SMTP | WhatsApp"] RegisterHandlers --> InitWhatsApp["Initialize WhatsApp Client
LocalAuth + Puppeteer"] InitWhatsApp --> QR["On QR Event
Generate Data URL"] InitWhatsApp --> Ready["On Ready/Auth Events
Clear QR, Emit Status"] InitWhatsApp --> Disconnected["On Disconnect
Cleanup Session"] QR --> UI["Renderer Receives QR"] Ready --> UI
Diagram sources
Section sources
Gmail Handler#
Handles OAuth2 authentication and email sending:
Validates environment variables
Opens browser window for consent
Exchanges authorization code for tokens
Stores tokens securely
Sends emails with progress reporting
Diagram sources
Section sources
SMTP Handler#
Manages SMTP configuration and sending:
Validates SMTP config
Saves credentials securely (excluding password)
Verifies connection
Sends emails with rate limiting and progress reporting
Section sources
Python Backend API#
Provides contact processing utilities:
Upload and parse CSV/Excel/Text files
Clean and validate phone numbers
Parse manually entered numbers
Validate individual numbers
Section sources
Key dependencies and their roles:
Diagram sources
Section sources
Common installation and runtime issues:
WhatsApp QR Code Not Loading
Check internet connection
Restart the application
Clear browser cache
Gmail Authentication Failed
Verify OAuth2 credentials
Check Google Cloud Console settings
Ensure Gmail API is enabled
SMTP Connection Issues
Verify server settings
Check firewall settings
Use correct port and security settings
Contact Import Errors
Check file format compatibility
Verify file encoding (UTF-8)
Ensure proper column headers
Additional checks:
Confirm Node.js 16+ and Python 3.8+ are installed
Ensure environment variables are correctly set
Verify development server runs on port 5173
Section sources
After completing setup, verify your installation:
Development Server
Confirm the React dev server starts on port 5173
Check Electron main process logs for successful window creation
WhatsApp Connection
Launch the app and connect to WhatsApp
Verify QR code appears and authenticates successfully
Check status updates in the activity log
Gmail API
Authenticate with Gmail
Send a test email to yourself
Review progress in the activity log
SMTP
Configure SMTP settings
Send a test email
Confirm delivery status
Python Backend
Start the Flask API
Test contact parsing endpoints
Verify response formats
Section sources
Once verified, explore advanced features:
Customize message templates
Configure rate limiting and delays
Export sending results and statistics
Integrate with external contact management systems
Package the application for distribution using electron-builder
Build targets are configured for macOS, Windows, and Linux distributions.
Section sources